import React from 'react';
import BraftEditor from 'braft-editor';
import staffContent from './staffContent';
import orgContent from './orgContent';
import orgListContent from './orgListContent';

import styles from './index.less';

const contentMap = {
    staff: {
        title: '员工管理',
        text: staffContent
    },
    orgList: {
        title: '公司管理',
        text: orgListContent
    },
    org: {
        title: '组织架构图',
        text: orgContent
    }
};

const Help = ({ location }) => {
    const { page } = location.query;
    const content = contentMap[page] || {};

    return (
        <div className={styles.layout}>
            <div className={styles.content}>
                <div className={styles.bread}>
                    用户帮助 / 组织架构 / <span>{content.title}</span>
                </div>
                <BraftEditor
                    controls={[]}
                    readOnly
                    style={{
                        border: 'none'
                    }}
                    value={BraftEditor.createEditorState(content.text)}
                />
            </div>
        </div>
    );
};
export default Help;
